<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class StoreArticlePostRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;//该为true才能提交
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()//规则
    {
        return [
            'title' =>'required',
            'author' =>'required',
            'content' =>'required',
        ];
    }
    public function messages()
    {
        return [
            'title.required' =>'文章标题不能为空',
            'author.required' =>'文章作者不能为空',
            'content.required' =>'文章内容不能为空',
        ];
    }
}
